<template>
	<div id="dz_main" class="page in " data-title="">    
   
   <div class="container">       
  
    <div class="search-wrap flex-wrap-start ptop1r" >
      <div><input type="text" id="search" name="search" ref="search" class="search-val"></div>
      <span class="search-btn" @click="nfquery">搜索</span>
    </div>
    
    <div class="main-wrap">
      
      <div class="banner-wrap">
           <img src="/static/img/banner.png" alt="">
      </div>
      
      <div class="main-ul flex-wrap-start auto">
        <div class="main-li flex-wrap-between" v-for="(item, index) in serieslist" :key="index"  @click="nfgoto(item.series_id)">
          <span>{{item.series}}</span><span class="icon add"></span>
        </div>

		<div class="main-li flex-wrap-between"  @click="nfgotocustom()">			
          		<span>自定义选配</span><span class="icon add"></span>
        </div>

      </div>

		<div style="padding-bottom: 50px;" ></div>
    </div>  
    
     
     
	  <!-- 底部菜单 -->
	<my-header  :menuitem="1"></my-header>

   </div>   
</div>
</template>

<script>
var mySelf;
	export default {
		data() {
			return {
				serieslist: []
			}
		},
		beforeCreate() {
			this.$myUtils.isLoginGotoPage();	
		},
		mounted() {
			mySelf = this;
			this.init();
		},
		methods: {
			init:function() {

				uni.showToast({
						title: '正在加载数据',
						icon:'loading',
						duration:1000
				});
 					
				this.$myUtils.myRequest({
					url: '/Series/getList',					
				}).then(res => {			 
					mySelf.serieslist = res.data.data.list; 
					if (mySelf.serieslist=='') {
							return uni.showToast({
							title: '未找到符合条件的数据',
							icon:'loading',
							duration:1000
                        });
					}
				
				})	
			},
			nfgoto:function(series_id){
				uni.navigateTo({  
                	url: '/pages/configinfo/configlist?series_id='+series_id
            	});
			},
			nfgotocustom:function(series_id){
				uni.navigateTo({  
                	url: '/pages/configinfo/custom'
            	});
			},
			nfquery:function() {				
				let _search = this.$refs.search.valueSync;
				if (_search=='') {
					return uni.showToast({
							title: '搜索栏必输',
							icon:'loading',
							duration:300
                        });
				}
				uni.navigateTo({  
                	url: '/pages/personal/history?q='+_search
            	});
			}
		}
	}
</script>

<style>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin: 200rpx auto 50rpx auto;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}

	.title {
		font-size: 36rpx;
		color: #8f8f94;
	}
</style>
